<?php

namespace App\HttpController\Api\Admin;

use App\Service\Admin\AdminService;
use EasySwoole\Http\Message\Status;

/**
 * 后台用户管理-控制器
 * @author LZH
 * @since: 2021/08/12
 * Class Admin
 */
class Admin extends AdminBase
{
    /**
     * 初始化方法
     * @author LZH
     * @since: 2021/08/12
     */
    protected function init(): void
    {
        $this->service = new AdminService();
    }

    /**
     * 重置密码
     */
    public function resetPwd()
    {
        $result = $this->service->resetPwd();

        if ($result) {
            return $this->respondNoContent();
        } else {
            return $this->failServerError();
        }
    }
}
